﻿<Window x:Class="Wpf2.Views.FormManageCategory"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Quản lý kho - Quản lý danh mục" MinHeight="600" MinWidth="600" MaxWidth="600"
        Icon="/Wpf2;component/Images/windows_icon.ico" Width="600"
        WindowStartupLocation="CenterScreen"
        >
    <Grid Margin="0,0,164,0" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="367*"/>
            <ColumnDefinition Width="13*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal" Margin="0,0,-164,0" Grid.ColumnSpan="2">
            <Border BorderBrush="#FF0012FF" BorderThickness="0" Margin="10,10,10,10">
                <StackPanel Orientation="Vertical">
                    <DataGrid x:Name="dtgDanhmuc" Height="550" SelectionUnit="FullRow"  CanUserAddRows="True" SelectionMode="Single" AutoGenerateColumns="False" ItemsSource="{Binding}"  LoadingRow="DtgDanhmucLoadingRow"  AlternatingRowBackground="PaleTurquoise" RowEditEnding="DtgDanhmucRowEditEnding">
                        <DataGrid.RowHeaderTemplate >
                            <DataTemplate>
                                <TextBlock  Width="20" Text="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}"/>
                            </DataTemplate>
                        </DataGrid.RowHeaderTemplate>
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Mã" Visibility="Hidden"  Width="10"  Binding="{Binding id_catalog,UpdateSourceTrigger=PropertyChanged}"/>
                            <DataGridTextColumn Header="Tên danh mục" Width="280"  Binding="{Binding CatalogName,UpdateSourceTrigger=PropertyChanged}">
                                <DataGridTextColumn.ElementStyle>
                                    <Style TargetType="TextBlock">
                                        <Setter Property="Margin" Value="10,0,0,0"  />
                                    </Style>
                                </DataGridTextColumn.ElementStyle>
                            </DataGridTextColumn>
                            <DataGridTextColumn Header="Ghi chú" Width="200" Binding="{Binding CatalogNotes,UpdateSourceTrigger=PropertyChanged}"/>
                            <DataGridTemplateColumn>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button x:Name="btnDelete" Width="50" Background="{x:Null}" Click="BtnDeleteClick" >
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="/Wpf2;component/Images/delete.png" Width="20" Height="20"/>
                                                <TextBlock Text="Xóa" VerticalAlignment="Center" Margin="2,0,0,0"/>
                                            </StackPanel>
                                        </Button>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </StackPanel>
            </Border>
        </StackPanel>
    </Grid>
</Window>
